import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

// import Layout from '@/layout'

const routes = [
  // 登录模块
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue')
  },
  // 公共模块
  {
    path: '/layout',
    component: () => import('@/layout/index.vue'),
    hidden: true,
    children: [
      // 用户详情
      {
        path: 'userList',
        name: 'userList',
        component: () => import('@/views/userList/index')
      },
      // 数据概览
      {
        path: 'showdata',
        name: 'showdata',
        component: () => import('@/views/showdata/index')
      },
      {
        path: 'discipline',
        name: 'discipline',
        component: () => import('@/views/discipline/index.vue')
      },
      {
        path: 'enterprise',
        name: 'enterprise',
        component: () => import('@/views/enterprise/index.vue')
      },
      {
        path: 'question',
        name: 'question',
        component: () => import('@/views/question/index.vue')
      },
      // 学科列表
      {
        path: 'science',
        name: 'science',
        component: () => import('@/views/science/index.vue')
      }
    ]
  },

  // 重定向
  {
    path: '',
    redirect: '/login'
  }
  // meta: { title: '用户列表', icon: 'list' }
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }

  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
